<!DOCTYPE html>
<html>
<head>
<title></title>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no" name="viewport">
<link rel="stylesheet" href="../../../css/bootstrap.min.css">
<link rel="stylesheet" href="../../../css/font-awesome.min.css">
<link rel="stylesheet" href="../../../plugins/jqgrid/ui.jqgrid-bootstrap.css">
<link rel="stylesheet" href="../../../plugins/datetimepicker/bootstrap-datetimepicker.min.css">
<link rel="stylesheet" href="../../../plugins/ztree/css/metroStyle/metroStyle.css">
<link rel="stylesheet" href="../../../css/main.css">
<script src="../../../libs/jquery.min.js"></script>
<script src="../../../plugins/layer/layer.js"></script>
<script src="../../../libs/bootstrap.min.js"></script>
<script src="../../../libs/vue.min.js"></script>
<script src="../../../plugins/jqgrid/grid.locale-cn.js"></script>
<script src="../../../plugins/jqgrid/jquery.jqGrid.min.js"></script>
<script src="../../../plugins/datetimepicker/bootstrap-datetimepicker.js"></script>
<script src="../../../plugins/datetimepicker/bootstrap-datetimepicker.min.js"></script>
<script src="../../../plugins/datetimepicker/bootstrap-datetimepicker.zh-CN.js"></script>
<script src="../../../plugins/ztree/jquery.ztree.all.min.js"></script>
<script src="../../../js/common.js"></script>
</head>
<body>
<div id="rrapp" v-cloak>
	<div v-show="showList">
		<div class="grid-btn">
			<div class="form-group col-sm-2">
				<input type="text" class="form-control" v-model="q.goodName" @keyup.enter="query" placeholder="商品名">
			</div>
			<div class="form-group col-sm-2">
				<select name="cat" v-model="q.cat" class="form-control"> 
					   <option>请选择类别</option>
					  <option v-for="option in sysCodeList" v-bind:value="option.code">  
					    {{ option.name }}  
					  </option>  
				  </select> 
			</div>
			<a class="btn btn-default" @click="query">查询</a>
			
			<a v-if="hasPermission('app:goodcoupon:save')" class="btn btn-primary" @click="add"><i class="fa fa-plus"></i>&nbsp;新增</a>
			<a v-if="hasPermission('app:goodcoupon:update')" class="btn btn-primary" @click="update"><i class="fa fa-pencil-square-o"></i>&nbsp;修改</a>
			<a v-if="hasPermission('app:goodcoupon:delete')" class="btn btn-primary" @click="del"><i class="fa fa-trash-o"></i>&nbsp;删除</a>
			<a v-if="hasPermission('app:goodcoupon:import')" class="btn btn-primary" @click="importGood"><i class="fa fa-trash-o"></i>&nbsp;淘宝导入商品</a>
		</div>
	    <table id="jqGrid"></table>
	    <div id="jqGridPager"></div>
    </div>
    
    <div v-show="!showList" class="panel panel-default">
		<div class="panel-heading">{{title}}</div>
		<form class="form-horizontal">
			<div class="form-group">
			   	<div class="col-sm-2 control-label">商品名称</div>
			   	<div class="col-sm-10">
			      <input type="text" class="form-control" name="title" v-model="goodCoupon.title" placeholder="商品名称"/>
			    </div>
			</div>
			
			<div class="form-group">
			   	<div class="col-sm-2 control-label">类型</div>
			   	<div class="col-sm-10">
			   		<select name="category" v-model="goodCoupon.category" class="form-control">  
					  <option v-for="option in sysCodeList" v-bind:value="option.id">  
					    {{ option.name }}  
					  </option>  
				  </select> 
			    </div>
			</div>
			<div class="form-group">
			   	<div class="col-sm-2 control-label">商品价格</div>
			   	<div class="col-sm-10">
			      <input type="text" class="form-control" name="zkFinalPrice" v-model="goodCoupon.zkFinalPrice" placeholder="商品价格"/>
			    </div>
			</div>
		   <div class="form-group">
			   	<div class="col-sm-2 control-label">剩余优惠券</div>
			   	<div class="col-sm-10">
			      <input type="text" class="form-control" name="couponRemainCount" v-model="goodCoupon.couponRemainCount" placeholder="剩余优惠券"/>
			    </div>
			</div>
			<div class="form-group">
			   	<div class="col-sm-2 control-label">商品图片</div>
			   	<div class="col-sm-10">
			      <input type="text" class="form-control" name="pictUrl" v-model="goodCoupon.pictUrl" placeholder="商品图片"/>
			    </div>
			</div>
			<div class="form-group">
			   	<div class="col-sm-2 control-label">优惠券地址</div>
			   	<div class="col-sm-10">
			      <input type="text" class="form-control" name="couponClickUrl" v-model="goodCoupon.couponClickUrl" placeholder="优惠券地址"/>
			    </div>
			</div>
			<div class="form-group">
			   	<div class="col-sm-2 control-label">开始时间</div>
			   	<div class="col-sm-10">
			      <input type="text" class="form-control form_datetime" name="couponStartTime" v-model="goodCoupon.couponStartTime" placeholder="开始时间"/>
			    </div>
			</div>
			<div class="form-group">
			   	<div class="col-sm-2 control-label">结束时间</div>
			   	<div class="col-sm-10">
			      <input type="text" class="form-control form_datetime" name="couponEndTime" v-model="goodCoupon.couponEndTime" placeholder="结束时间"/>
			    </div>
			</div>
			<div class="form-group">
			   	<div class="col-sm-2 control-label">详情</div>
			   	<div class="col-sm-10">
			      <input type="text" class="form-control" name="couponInfo" v-model="goodCoupon.couponInfo" placeholder="商品名称"/>
			    </div>
			</div>
			<div class="form-group">
			   	<div class="col-sm-2 control-label">优惠券额度</div>
			   	<div class="col-sm-10">
			      <input type="text" class="form-control" name="couponPrice" v-model="goodCoupon.couponPrice" placeholder="优惠券额度"/>
			    </div>
			</div>
			<div class="form-group">
			   	<div class="col-sm-2 control-label">商品地址</div>
			   	<div class="col-sm-10">
			      <input type="text" class="form-control" name="itemUrl" v-model="goodCoupon.itemUrl" placeholder="商品地址"/>
			    </div>
			</div>
			<div class="form-group">
			   	<div class="col-sm-2 control-label">缩略图</div>
			   	<div class="col-sm-10">
			      <input type="text" class="form-control" name="smallImagesf" v-model="goodCoupon.smallImagesf" placeholder="缩略图"/>
			    </div>
			</div>
			<div class="form-group">
			   	<div class="col-sm-2 control-label">佣金率</div>
			   	<div class="col-sm-10">
			      <input type="text" class="form-control" name="commissionRate" v-model="goodCoupon.commissionRate" placeholder="佣金率"/>
			    </div>
			</div>
			<div class="form-group">
				<div class="col-sm-2 control-label"></div> 
				<input type="button" class="btn btn-primary" @click="saveOrUpdate" value="确定"/>
				&nbsp;&nbsp;<input type="button" class="btn btn-warning" @click="reload" value="返回"/>
			</div>
		</form>
	</div>
</div>

<div id="showIndex" style="display: none;padding:10px;">
	开始:<input id="indexstart" name="indexstart" /><br>
	结束:<input id="indexend" name="indexend"/>
</div>

<script src="../../../js/modules/app/good/goodcoupon.js"></script>
</body>
</html>